{% extends 'base.html' %}
{% block content %}
<title>{{ title }} - 视频平台</title>
<div class="container mt-4">
    <h1 class="text-center text-primary">{{ title }}</h1>
    <h3 class="text-center text-primary">{{ title }} UI 设计简约大气的</h3>
    <h3 class="text-center text-primary">如果部分UI未生效，请清除浏览器缓存已生效新的UI</h3>
    <h3 class="mt-4">视频列表：</h3>
    <div class="row">
        {% for video in videos %}
        <div class="col-md-4 mb-4">
            <div class="card h-100 shadow-sm">
                <img src="{{ url_for('static', filename='uploads/covers/' ~ video['cover_filename']) }}" 
                     class="card-img-top" 
                     alt="视频封面" 
                     style="height: 200px; object-fit: cover;">
                <div class="card-body d-flex flex-column">
                    <h5 class="card-title text-truncate">{{ video['title'] }}</h5>
                    <p class="card-text text-muted text-truncate">{{ video['description'] }}</p>
                    <p class="card-text">
                        <small class="text-muted">上传者：{{ video['uploader'] }}</small><br>
                        <small class="text-muted">上传时间：{{ video['upload_time'] }}</small><br>
                        <small class="text-muted">播放次数：{{ video['play_count'] }}</small><br>
                        <small class="text-muted"><font color="#FF0000">视频由用户自主上传，与该平台无关</font></small>
                    </p>
                    <div class="mt-auto">
                        <a target="_blank" href="{{ url_for('play', video_filename=video['video_filename']) }}" class="btn btn-primary btn-block">
                            观看
                        </a>
                    </div>
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %}
